home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / workbench+shell / a-f / extrainfo / extrainfo.install < prev    next >
Text File  |  1995-08-15  |  10KB  |  434 lines

  1. ; *************************************************************************
  2. ; ********************  EXTRAINFO INSTALLATION SCRIPT  ********************
  3. ; *************************************************************************
  4. ;
  5. ; $VER: ExtraInfo.install 1.3 (15.8.95)
  6. ;
  7. ; Copyright ©1995 Nick Christie
  8. ;
  9. ; *************************************************************************
  10. ;
  11. ; Find out about program version, etc
  12.  
  13. ; get version of EI in distribution
  14. (set vernum-ei (getversion "ExtraInfo"))
  15. (set ver-ei    (/ vernum-ei 65536))
  16. (set rev-ei    (- vernum-ei (* ver-ei 65536) ) )
  17.  
  18. (set @default-dest "")
  19. (set defeidir "SYS:")
  20. (set defewbidir "SYS:WBStartup")
  21. (set catsdir "Locale:Catalogs")
  22. (set catfile "ExtraInfo.catalog")
  23. (set libsdir "Libs:")
  24.  
  25. ; if novice user-level, bump up to average
  26. (if (= 0 @user-level)
  27.     (
  28.     (set @user-level 1)
  29.     (user 1)
  30.     )
  31. )
  32.  
  33. (set old-user-level @user-level)
  34.  
  35. ; ************************************************************************
  36. ; English strings
  37. ; ************************************************************************
  38.  
  39. (set default_lang 1)
  40.  
  41. (set #yes-msg "Yes")
  42.  
  43. (set #no-msg "No")
  44.  
  45. (set #bad-kick-msg "ExtraInfo requires AmigaOS 2.04 or better!")
  46.  
  47. (set #hello-msg
  48.     (cat
  49.         ("Welcome to ExtraInfo V%ld.%ld\n\n" ver-ei rev-ei)
  50.         "This script will install ExtraInfo and "
  51.         "related files on your Amiga.\n\n"
  52.         "You will need to answer a few questions such as "
  53.         "where you would like the program installed.\n\n"
  54.         "If you do not wish to install ExtraInfo at this time, "
  55.         "select the 'Abort Install' button now. "
  56.     )
  57. )
  58.  
  59. (set #ei-askdir-msg "Select the directory to install ExtraInfo in.")
  60.  
  61. (set #ei-askicon-msg "Please select your preferred icon style:\n")
  62.  
  63. (set #bgui-askdir-msg
  64.     (cat
  65.         "Select the directory to install bgui.library in. "
  66.         "(Will *not* overwrite an existing newer version.)"
  67.     )
  68. )
  69.  
  70. (set #eiai-ask-msg "\nDo you wish to install the standard AppIcon?")
  71.  
  72. (set #eiai-ask-help
  73.     (cat
  74.         "If you select 'Yes' the standard AppIcon will be installed "
  75.         "in a directory of your choice. Select 'No' if you do not wish "
  76.         "to use the AppIcon facility, or if you will be providing your "
  77.         "own AppIcon image."
  78.     )
  79. )
  80.  
  81. (set #eiai-askdir-msg "Select the directory to install the AppIcon in.")
  82.  
  83. (set #eiguide "ExtraInfo.guide")
  84.  
  85. (set #eiguide-ask-msg
  86.     (cat
  87.         "\nInstall ExtraInfo documentation?\n\n"
  88.         "(This is an AmigaGuide file, and you will be asked "
  89.         "for the directory in which to install it.)\n\n"
  90.         "I recommend installing this, and reading it too, "
  91.         "so that you know how to utilitise ExtraInfo to "
  92.         "its fullest. "
  93.     )
  94. )
  95.  
  96. (set #eiguide-askdir-msg
  97.     "Select the directory to install ExtraInfo.guide in."
  98. )
  99.  
  100. (set #guide-help
  101.     (cat
  102.         "AmigaGuide is the Amiga's standard hypertext format.\n\n"
  103.         "If you have AmigaOS 3.0 or better, you can use MultiView "
  104.         "to read this documentation, otherwise you must use the AmigaGuide "
  105.         "program, which is available on AmiNet and Fred Fish disk #870.\n\n"
  106.         "Both of these viewer programs have a 'search path', a set "
  107.         "of directories they search for AmigaGuide documents. "
  108.         "You should place this guide somewhere in that path."
  109.     )
  110. )
  111.  
  112. (set #ewbi-ask-msg
  113.     (cat
  114.         "Would you like to install ExtraWBInfo?\n\n"
  115.         "This program redirects the Workbench Icon Information "
  116.         "menu item so that it calls up ExtraInfo instead of "
  117.         "Workbench's own Information requester."
  118.     )
  119. )
  120.  
  121. (set #ewbi-help
  122.     (cat
  123.         "Install ExtraWBInfo if you would like to replace Workbench's "
  124.         "own Information window with that of ExtraInfo.\n\n"
  125.         "ExtraWBInfo is normally placed in the WBStartUp drawer so "
  126.         "that it starts up every time you boot your Amiga. It does "
  127.         "not have (or need) a window of its own, but you can turn "
  128.         "it on and off using the Commodities Exchange program."
  129.     )
  130. )
  131.  
  132. (set #ewbi-askdir-msg
  133.     "Select the directory to install ExtraWBInfo in."
  134. )
  135.  
  136. (set #ewbiguide "ExtraWBInfo.guide")
  137.  
  138. (set #ewbiguide-ask-msg
  139.     (cat
  140.         "\nInstall ExtraWBInfo documentation?\n\n"
  141.         "(This is an AmigaGuide file, and you will be asked "
  142.         "for the directory in which to install it.)"
  143.     )
  144. )
  145.  
  146. (set #ewbiguide-askdir-msg
  147.     "Select the directory to install ExtraWBInfo.guide in."
  148. )
  149.  
  150. (set #locale-msg
  151.     (cat
  152.         "\ExtraInfo is localized and has been translated "
  153.         "into the following languages. Please indicate "
  154.         "which translations you wish to install.\n"
  155.     )
  156. )
  157.  
  158. (set #locale-help
  159.     (cat
  160.         "These are the languages supported by ExtraInfo.\n\n"
  161.         "Simply specify the languages you prefer and the "
  162.         "required catalog files will be copied to the "
  163.         "Locale:Catalogs directory.\n\n"
  164.         "Note that the English language is built-in and "
  165.         "does not require a catalog file."
  166.     )
  167. )
  168.  
  169. ; ************************************************************************
  170. ; xxxx strings - template for other languages
  171. ; ************************************************************************
  172.  
  173. (if (= @language "xxxx")
  174.     (
  175.     (set default_lang ?)
  176.  
  177.  
  178.     ) ; endif xxxx language
  179. )
  180.  
  181. ; ************************************************************************
  182. ; Begin actual installation
  183. ; ************************************************************************
  184.  
  185. ; Check for KickV37 or better
  186.  
  187. (if (< (/ (getversion) 65536) 37)
  188.     (
  189.     (abort #bad-kick-msg)
  190.     )
  191. )
  192.  
  193. ; ------------------------------------------------------------------------
  194. ; Show welcome msg
  195.  
  196. (user 2)
  197. (message #hello-msg)
  198. (user old-user-level)
  199.  
  200. ; ------------------------------------------------------------------------
  201. ; Ask the user where we should install ExtraInfo.
  202.  
  203. (set eidir
  204.     (askdir
  205.         (prompt #ei-askdir-msg)
  206.         (help @askdir-help)
  207.         (default defeidir)
  208.     )
  209. )
  210.  
  211. (set @default-dest eidir)
  212.  
  213. ; ------------------------------------------------------------------------
  214. ; Ask the user which icon style (if any) s/he would prefer.
  215.  
  216. (set iconstyle
  217.     (askchoice
  218.         (prompt #ei-askicon-msg)
  219.         (help @askchoice-help)
  220.         (choices "MagicWB (8 colour)" "Standard (4 colour)" "Neither")
  221.         (default 0)
  222.     )
  223. )
  224.  
  225. ; ------------------------------------------------------------------------
  226. ; Install ExtraInfo, along with the desired icon.
  227.  
  228. (copyfiles (source "ExtraInfo") (dest eidir) )
  229.  
  230. (if (= 0 iconstyle)
  231.     (copyfiles (source "ExtraInfo.info") (dest eidir) )
  232. )
  233. (if (= 1 iconstyle)
  234.     (copyfiles
  235.         (source (tackon "4ColourIcons" "ExtraInfo.info"))
  236.         (dest eidir)
  237.     )
  238. )
  239.  
  240. ; ------------------------------------------------------------------------
  241. ; Install BGUI library. If expert, ask for directory.
  242.  
  243. (if (= 2 @user-level)
  244.     (set libsdir
  245.         (askdir
  246.             (prompt #bgui-askdir-msg)
  247.             (help @askdir-help)
  248.             (default libsdir)
  249.         )
  250.     )
  251. )
  252.  
  253. (copylib (source "Libs/bgui.library") (dest libsdir)
  254. )
  255.  
  256. ; ------------------------------------------------------------------------
  257. ; Install ExtraInfo.appicon. Ask yes/no first, then ask for directory.
  258.  
  259. (set aidir eidir)
  260.  
  261. (if (askbool
  262.         (prompt #eiai-ask-msg)
  263.         (help #eiai-ask-help)
  264.         (default 1)
  265.         (choices #yes-msg #no-msg)
  266.     )
  267.     ; then
  268.     (
  269.     (set aidir
  270.         (askdir
  271.             (prompt #eiai-askdir-msg)
  272.             (help @askdir-help)
  273.             (default aidir)
  274.         )
  275.     )
  276.  
  277.     (if (= 1 iconstyle)
  278.         (copyfiles
  279.             (source (tackon "4ColourIcons" "ExtraInfo.appicon.info"))
  280.             (dest aidir)
  281.         )
  282.         (copyfiles (source "ExtraInfo.appicon.info") (dest aidir) )
  283.     )
  284.  
  285.     (tooltype
  286.         (dest (tackon eidir "ExtraInfo"))
  287.         (settooltype "APPICONNAME" (tackon aidir "ExtraInfo.appicon"))
  288.     )
  289.     )
  290. )
  291.  
  292. ; ------------------------------------------------------------------------
  293. ; Install ExtraInfo.guide. Ask yes/no first, then ask for directory.
  294.  
  295. (set guidedir eidir)
  296.  
  297. (if (askbool
  298.         (prompt #eiguide-ask-msg)
  299.         (help #guide-help)
  300.         (default 1)
  301.         (choices #yes-msg #no-msg)
  302.     )
  303.     ; then
  304.     (
  305.     (set guidedir
  306.         (askdir
  307.             (prompt #eiguide-askdir-msg)
  308.             (help @askdir-help)
  309.             (default guidedir)
  310.         )
  311.     )
  312.     (copyfiles (source #eiguide) (dest guidedir) (infos) )
  313.     )
  314. )
  315.  
  316. ; ------------------------------------------------------------------------
  317. ; Install ExtraWBInfo if V38+. Ask yes/no first, then ask for directory.
  318.  
  319. (if (> (/ (getversion) 65536) 37)
  320.     (
  321.     (set ewbidir defewbidir)
  322.  
  323.     (if (askbool
  324.             (prompt #ewbi-ask-msg)
  325.             (help #ewbi-help)
  326.             (default 1)
  327.             (choices #yes-msg #no-msg)
  328.         )
  329.         ; then
  330.         (
  331.         (set ewbidir
  332.             (askdir
  333.                 (prompt #ewbi-askdir-msg)
  334.                 (help @askdir-help)
  335.                 (default defewbidir)
  336.             )
  337.         )
  338.  
  339.         (copyfiles (source "ExtraWBInfo") (dest ewbidir))
  340.  
  341.         (if (= 0 iconstyle)
  342.             (copyfiles (source "ExtraWBInfo.info") (dest ewbidir) )
  343.         )
  344.  
  345.         (if (= 1 iconstyle)
  346.             (copyfiles
  347.                 (source (tackon "4ColourIcons" "ExtraWBInfo.info"))
  348.                 (dest ewbidir)
  349.             )
  350.         )
  351.  
  352.         (tooltype
  353.             (dest (tackon ewbidir "ExtraWBInfo"))
  354.             (settooltype "EXTRAINFOCMD" (tackon eidir "ExtraInfo"))
  355.         )
  356.  
  357.         (set ewbiguidedir ewbidir)
  358.  
  359.         (if (askbool
  360.                 (prompt #ewbiguide-ask-msg)
  361.                 (help #guide-help)
  362.                 (default 1)
  363.                 (choices #yes-msg #no-msg)
  364.             )
  365.             ; then
  366.             (
  367.             (set ewbiguidedir
  368.                 (askdir
  369.                     (prompt #ewbiguide-askdir-msg)
  370.                     (help @askdir-help)
  371.                     (default ewbiguidedir)
  372.                 )
  373.             )
  374.             (copyfiles (source #ewbiguide) (dest ewbiguidedir) (infos) )
  375.             )
  376.         )
  377.         )
  378.     )
  379.     )
  380. )
  381.  
  382. ; ------------------------------------------------------------------------
  383. ; Install catalog file(s)
  384.  
  385. (if (exists "libs:locale.library")
  386.     (
  387.     (if (exists catsdir)
  388.         (
  389.         (set lang
  390.             (askoptions
  391.                 (prompt #locale-msg)
  392.                 (help #locale-help)
  393.                 (choices
  394.                     "English"
  395.                     "Deutsch"
  396.                     "Italiano"
  397.                 )
  398.                 (default default_lang)
  399.             )
  400.         )
  401.         (set n 0)
  402.         (while
  403.             (set language
  404.                 (select n
  405.                     "English"
  406.                     "Deutsch"
  407.                     "Italiano"
  408.                     ""
  409.                 )
  410.             )
  411.             (
  412.                 (if (in lang n)
  413.                     (
  414.                     (if (<> 0 n)
  415.                         (
  416.                         (makedir (cat catsdir "/" language))
  417.                         (copyfiles
  418.                             (source (cat "Catalogs/" language "/" catfile))
  419.                             (dest (cat catsdir "/" language))
  420.                         )
  421.                         )
  422.                     )
  423.                     )
  424.                 )
  425.                 (set n (+ n 1))
  426.             )
  427.         ) ; endwhile pick language n
  428.         ) ; endthen
  429.     ) ; endif exists catsdir
  430.     ) ; endthen
  431.  
  432. ) ; endif exists locale lib
  433.  
  434.